<template>
  <div>
    <p>current Number {{$store.state.number}} is {{$store.getters.eventOrdOdd}}</p>
    <button @click="increment()">+</button>
    <button @click="decrement()">-</button>

  </div>
</template>

<script>

export default {
  name: "Vuex1",
  methods:{
    increment(){
      //调用action
      this.$store.dispatch('increment')
    },
    decrement(){
      this.$store.dispatch('decrement')
    }
  }
}
</script>

<style scoped>

</style>
